<template>
	<!-- 线下买单 -->
	<view class="content">
		<view class="order-item" v-for="item in list" :key="item.id" @click="$navTo('/pages/order/details?id='+item.id)">
			<view class="order_info">
				<view class="title clamp">{{item.supname}} ></view>
				<text class="o_status" v-if="item.status==3&&item.evaluate==0">待评价</text>
				<text class="o_status" v-if="item.status==3&&item.evaluate==1">已完成</text>
				<text class="o_status" v-if="item.status!=3">待消费</text>
			</view>
			<view class="goods_info">
				<image class="goods-img" :src="item.logo" mode="aspectFill"></image>
				<view class="right">
					<view class="sattus2">支付成功</view>
					<view class="g_pay">线下扫码</view>
				</view>
				<view class="g_price">
					<text class="small">￥</text><text class="price">{{item.goodsprice}}</text>
				</view>
			</view>
			<view class="order_youhui" v-if="item.discountprice!='0.00'">
				<view class="left">
					<image src="/static/youhui.png" mode="widthFix"></image>
					<text>多米街支付优惠</text>
				</view>
				<text>-￥{{item.discountprice.toFixed(2)}}</text>
			</view>
			<view class="time">
				<text class="p_time">{{item.paytime}}</text>
				<view>实付：<text class="small">￥</text><text class="price">{{item.price}}</text></view>
			</view>
			<view class="btns">
				<view class="border" v-if="item.status!=3" @click.stop="$navTo('../order/details?id='+item.id)">去核销</view>
				<view class="border" v-if="item.status==3&&item.evaluate==0" @click.stop="$navTo('../order/evaluate?id='+item.id)">去评价</view>
				<view class="bg" v-if="item.status==3" @click.stop="$navTo('/pages/shoplist/shopgoods?id='+item.uid)">再来一单</view>
			</view>
		</view>
		<view class="loading_message">
			<image v-if="isloading" src="/static/business/loading.gif" ></image>
			<text v-if="ismore">到底了~</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'ZiOrder',
		props: {
			list: {
				type: Array,
				default: () => []
			},
			isloading: {
				type: Boolean,
				default: false
			},
			ismore: {
				type: Boolean,
				default: true
			}
		},
	}
</script>

<style lang="scss">
	.content {
		padding: 14rpx 18rpx;
	}

	.order-item {
		background: #fff;
		border-radius: 12rpx;
		padding: 20upx;
		margin-bottom: 20upx;
		.order_info{
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-weight: 600;
			border-bottom: 1rpx solid #E9E9E9;
			padding-bottom: 20rpx;
			.title{
				font-size: 28rpx;
				color: #333333;
			}
			.o_status{
				font-size: 24rpx;
				color: #8615E1;
			}
		}
		.goods_info{
			align-items: center;
			display: flex;
			justify-content: space-between;
			margin: 20rpx 0;
			image {
				border-radius: 10upx;
				height: 120upx;
				width: 120upx;
			}
			
			.right {
				padding-left: 20upx;
				line-height: 40upx;
				width: calc(100% - 280rpx);
			
				.sattus2 {
					font-size: 24rpx;
					color: #333333;
					flex: 1;
				}
				.g_pay{
					font-size: 20rpx;
					color: #999999;
				}
			}
			.g_price{
				color: #333;
				font-size: 36rpx;
				font-weight: 600;
				width: 160rpx;
				text-align: right;
				white-space: nowrap;
				.small{
					font-size: 24rpx;
				}
			}
		}
		.order_youhui{
			height: 54rpx;
			background: #FBF8FE;
			border-radius: 8rpx;
			align-items: center;
			display: flex;
			justify-content: space-between;
			font-size: 20rpx;
			color: #8615E1;
			padding: 0 20rpx;
			.left{
				display: flex;
				align-items: center;
				image{
					width: 20rpx;
					margin-right: 10rpx;
					display: block;
				}
			}
		}
		.time{
			display: flex;
			justify-content: space-between;
			align-items: flex-end;
			margin: 10rpx 0;
			.p_time{
				font-size: 20rpx;
				color: #999999;
			}
			view{
				font-size: 20rpx;
				color: #333333;
				.small{
					color:#AF141D;
					font-weight: 600;
				}
				.price{
					font-size: 32rpx;
					color:#AF141D;
					font-weight: 600;
				}
			}
		}
		.btns{
			display: flex;
			justify-content: flex-end;
			margin-top: 16rpx;
			view{
				width: 122rpx;
				height: 46rpx;
				border-radius: 8rpx;
				border: 2rpx solid #9300EA;
				font-size: 24rpx;
				color: #8615E1;
				margin-left: 20rpx;
				line-height: 46rpx;
				text-align: center;
			}
			.bg{
				background: #8615E1;
				color: #FFFFFF;
			}
		}
	}

	.loading_message {
		color: #0062CC;
		padding: 20upx;
		text-align: center;
	}

	.loading_message image {
		height: 50upx;
		width: 50upx;
	}
</style>